<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>复制口令打开淘宝</title>
<meta name="Description" content="医保指社会医疗保险。社会医疗保险是国家和社会根据一定的法律法规，为向保障范围内的劳动者提供患病时基本医疗需求保障而建">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,minimum-scale=1.0, maximum-scale=1.0,width=device-width">
<style type="text/css">
body {
	background: #F6F5F7;
}
.imgContainer {
	padding: 0 16px;
	margin-top: 14px;
}
.imgContainer img {
	width: 100%;
	height: auto;
	box-shadow: 0px 3px 12px rgba(21, 0, 71, 0.16);
}
.beatWord {
	text-align: center;
	margin: 14px;
	margin-top: 20px;
}
.fieldset {
	padding: 0.8em;
	margin: 0 2px;
	border: 1px dashed #f54d23;
	background: #fff;
}

.fieldset2{

}
.legend {
	background: #f54d23;
	border: none;
	font-size: 0.8rem;
	line-height: 20px;
	color: #fff;
	padding: 0 4px;
	top: -20px;
	position: relative;
}
.itemCopy, .itemCopy2{
	border: none;
	font-size: 16px;
	padding: 6px 15px;
	background: #f60;
	display: inline-block;
	margin: 10px auto;
	border-radius: 16px;
	color: #fff;
}
.itemCopy2{
	background: #f00;
	display:none;
}
.qrbtn {
	border: none;
	font-size: 16px;
	padding: 6px 15px;
	background: #f00;
	display: inline-block;
	margin: 10px auto;
	border-radius: 16px;
	color: #fff;
}
.itemWord,.itemWord2 {
	font-size: 12px;
	top: -10px;
	position: relative;
}
.kz-float-layer {
	height: 0px!important;
}
.kz-float-layer {
	display: none!important;
}
</style>
<script type="text/javascript" src="//lib.baomitu.com/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript" src="//lib.baomitu.com/clipboard.js/1.6.1/clipboard.min.js"></script>
</head>

<body>
<div class="beatWord">
	<div id="itemBox1" style="display:none;">
        <div class="fieldset">
            <div id="copy_tip" class="legend">长按框内>全选>复制>打开淘@宝APP</div>
            <p id="itemWord" class="itemWord">复制框内整段文字，打开「淘@宝APP」即可「领取秘密券」并购买<span id="koulin"></span>
            </p>
        </div>
        <div type="button" data-clipboard-text="" class="itemCopy" id="itemCopy" onclick="">一键复制</div>
				👉 <a href="http://tt.dd.jdlebuy.com/index.php?r=realtime/wap" style="background: #00BB00;border: none;font-size: 16px;padding: 6px 15px;display: inline-block;margin: 10px 4px 10px 4px;border-radius: 16px;color: #fff;text-decoration: none;">实时秒杀榜</a><span
        <a id="pcurl1" href="" style="background: #00a1ff;border: none;font-size: 16px;padding: 6px 15px;display: inline-block;margin: 10px 4px 10px 4px;border-radius: 16px;color: #fff;text-decoration: none;">一键购买</a>
    </div>
    <div id="itemBox2" style="display:none;">
        <div class="fieldset fieldset2" style="border-color: #f00;margin-top:10px;">
            <div id="copy_tip" class="legend" style="background-color: #f00;">双十一红包会场</div>
            <p id="itemWord2" class="itemWord2">复制文字，打开「手T」领取双十一红包 <span id="koulin2"></span>
            </p>
        </div>
        <div type="button" data-clipboard-text="" class="itemCopy2" id="itemCopy2" onclick="">领取双11红包</div>
        <a id="pcurl2" href="" style="background: #00a1ff;border: none;font-size: 16px;padding: 6px 15px;display: inline-block;margin: 10px 4px 10px 4px;border-radius: 16px;color: #fff;text-decoration: none;">一键领取</a>
    </div>
</div>
<div class="imgContainer">
    <img id="img" src="">
</div>
<script>
window.mobileUtil = (function (h, g) {
  var d = navigator.userAgent,
  c = /android|adr|linux/gi.test(d),
  b = /iphone|ipod|ipad/gi.test(d) && !c,
  e = /BlackBerry/i.test(d),
  f = /IEMobile/i.test(d),
  a = c || b || e || f;
  return {
    isAndroid: c,
    isIOS: b,
    isMobile: a,
    isWeixin: /MicroMessenger/gi.test(d),
    isQQ: / QQ/gi.test(d),
    isPC: !a
  }
}) (window, document);

//获得参数
function getQueryVariable(variable){
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
	var pair = vars[i].split("=");
	if(pair[0] == variable){
		return unescape(pair[1]);}
	}
	return(false);
}

$(function() {
	var itempic = getQueryVariable("picurl");
	var url = getQueryVariable('url');	
	var taowords = getQueryVariable("taowords");
	var tkl1111 = getQueryVariable("tkl1111");
	var itemid = getQueryVariable("itemid");	
	
	$("#img").attr('src',itempic);
	
	if(taowords.length > 0){
		$('#itemBox1').show();
		var twords = '￥' + taowords.match(/\w+/) + '￥';
		$("#itemCopy").attr("data-clipboard-text", twords);
		$("#koulin").html(twords);
		
		//复制文本
		var clipboard = new Clipboard('.itemCopy');
		clipboard.on('success',function(e) {
		  $("#img").attr('src',itempic);
		  if (e.trigger.disabled == false || e.trigger.disabled == undefined) {
			e.trigger.innerHTML = "复制成功，打开掏寳APP购买";
			e.trigger.style.backgroundColor = "#9ED29E";
			e.trigger.style.borderColor = "#9ED29E";
			e.trigger.disabled = true;
			setTimeout(function() {
			  e.trigger.innerHTML = "一键复制";
			  e.trigger.style.backgroundColor = "#f54d23";
			  e.trigger.style.borderColor = "#f54d23";
			  e.trigger.disabled = false;
			},
			2000);
		  }
		});
		clipboard.on('error',
		function(e) {
		  e.trigger.innerHTML = "复制失败,请手动复制";
		  e.trigger.style.backgroundColor = "#8f8f8f";
		  e.trigger.style.borderColor = "#8f8f8f";
		});
	}
	
	if(tkl1111.length > 0){
		$('#itemBox2').show();
		
		tkl1111 = '￥' + tkl1111 + '￥';
		$("#koulin2").html(tkl1111);
		$("#itemCopy2").attr("data-clipboard-text",tkl1111).css('display','inline-block');
		
		var clipboard2 = new Clipboard('.itemCopy2');
		clipboard2.on('success',function(e) {
		  if (e.trigger.disabled == false || e.trigger.disabled == undefined) {
			e.trigger.innerHTML = "复制成功，打开掏寳领取";
			e.trigger.style.backgroundColor = "#9ED29E";
			e.trigger.style.borderColor = "#9ED29E";
			e.trigger.disabled = true;
			setTimeout(function() {
			  e.trigger.innerHTML = "领取双11红包";
			  e.trigger.style.backgroundColor = "#f54d23";
			  e.trigger.style.borderColor = "#f54d23";
			  e.trigger.disabled = false;
			},
			2000);
		  }
		});
	
		clipboard.on('error', function(e) {
		  e.trigger.innerHTML = "复制失败,请手动复制";
		  e.trigger.style.backgroundColor = "#8f8f8f";
		  e.trigger.style.borderColor = "#8f8f8f";
		});
	}
	
	if(mobileUtil.isWeixin || url.length == false){
		$('#pcurl1').hide();
		$('#pcurl2').hide();
	}	
	else{		
		$('#pcurl1').attr('href', url);
		
		if(mobileUtil.isQQ){
			$('#pcurl1').bind('click', function(){
				if(mobileUtil.isAndroid){
					var href = $(this).attr('href');
					var b = href.replace('http://', '').replace('https://', '');
					var e = document.createElement('iframe');
					e.src = 'taobao://' + b;
					e.style.display = 'none';
					document.body.appendChild(e);
					window.location.href = href;
					return false;
				}
				
				if(mobileUtil.isIOS){
					var href = $(this).attr('href');
					window.location.href = 'https://t.asczwa.com/taobao?backurl=' + encodeURIComponent(href);
					return false;
				}
				
				return true;				
			});
		}
		
		var url11 = getQueryVariable('url1111');
		if(url11 == false){
			$('#pcurl2').hide();
		}else{
			$('#pcurl2').attr('href', url11);
			if(mobileUtil.isQQ){
				$('#pcurl2').bind('click', function(){
					if(mobileUtil.isAndroid){
						var href = $(this).attr('href');
						var b = href.replace('http://', '').replace('https://', '');
						var e = document.createElement('iframe');
						e.src = 'taobao://' + b;
						e.style.display = 'none';
						document.body.appendChild(e);
						window.location.href = href;
						return false;
					}
					
					if(mobileUtil.isIOS){
						var href = $(this).attr('href');
						window.location.href = 'https://t.asczwa.com/taobao?backurl=' + encodeURIComponent(href);
						return false;
					}
					
					return true;				
				});
			}
		}
	}
					
	//自动选中
	var word = document.querySelector('.itemWord');
	$('.itemWord').on("touchstart",function(){
		word = document.querySelector('.itemWord');
	}).on("mouseover",function(){
		word = document.querySelector('.itemWord');
	}).on("click",function(){
		word = document.querySelector('.itemWord');
	});
	
	$('.itemWord2').on("touchstart",function(){
		word = document.querySelector('.itemWord2');
	}).on("mouseover",function(){
		word = document.querySelector('.itemWord2');
	}).on("click",function(){
		word = document.querySelector('.itemWord2');
	});
	
	document.addEventListener("selectionchange", function(e) {
		window.getSelection().selectAllChildren(word);
	}, false);	
});
</script>
</body>
</html>
